-
Notifications
You must be signed in to change notification settings - Fork 31
Provide an API to interact with CalDav server #1465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tmail-backend/apps/memory/src/main/java/com/linagora/tmail/james/app/MemoryServer.java
Show resolved
Hide resolved
...end/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/card/CardDavHandler.java
Outdated
Show resolved
Hide resolved
5dc96d3
to
0df173e
Compare
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...y/openpaas/src/main/java/com/linagora/tmail/dav/request/GetCalendarByEventIdRequestBody.java
Outdated
Show resolved
Hide resolved
...ackend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/xml/CalendarData.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...il-third-party/openpaas/src/main/java/com/linagora/tmail/configuration/DavConfiguration.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
7c99cbe
to
c448e55
Compare
Note: For some reason, I had to force push. Anyway, the only new commit is c448e55. |
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...kend/tmail-third-party/openpaas/src/test/java/com/linagora/tmail/dav/DavServerExtension.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
.switchIfEmpty(Mono.fromRunnable( | ||
() -> LOGGER.trace("VEvent '{}' was not found in Calendar '{}'.", eventUid, calendarURI))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReactorUtils.logAsMono in order to be more idiomatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't because logAsMono is not generic. It returns Mono<Void> while we need Mono<Calendar>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReactorUtils.logAsMono(() -> LOGGER...).thenReturn(calendar)
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then we need to thenReturn(null)
. In my opinion, unless we make logAsMono generic, this is the best syntax we can achieve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://projectreactor.io/docs/core/release/api/reactor/util/context/Context.html
Yes but it looses context. So please comply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, done. Should we open a PR in James to make logAsMono generic?
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
To be adopted at the James scale if needed. Feel free to post an email about this onto |
@HoussemNasri you need to rebase in order to solve conflict |
Basic rule when doing optimistic transactions: This will need to be retried. THe total number of retries need to be bounded and low: 5 max.... |
Reviewed. There is still a merge conflict over here! |
b70ba7e
to
a0ab5f9
Compare
Can we write a clean history here with |
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...kend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClientException.java
Outdated
Show resolved
Hide resolved
f21f149
to
ced7adc
Compare
<dependency> | ||
<groupId>org.wiremock</groupId> | ||
<artifactId>wiremock-standalone</artifactId> | ||
<version>3.10.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten <scope>test</scope>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to summarize the current issue with dependencies:
- Wiremock imports a library called
json-schema-validator
. - This library is being imported by
mockserver
too but uses an old and uncompatible version. - At class-load time, this library reads a localization JSON file, parses it, and caches the object in memory.
- This file is not stored under a package name but rather stored in the root of the resources folder.
- This creates a conflict between the two localization files imported by Wiremock and Mockserver and one would override the other.
- As the versions of the library imported are incompatible, using the code of version A to read the config of version B fails.
- The two versions can co-exist because the wiremock library is imported as standalone: https://github.com/wiremock/wiremock/blob/f91326573547a90fd143252d77961eaa0345dbb1/build.gradle#L284
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok shading dependencies is really OK in this context.
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
[ERROR] Crashed tests: |
We've updated ical4j to version 4.1.0 in tmail-backend |
Can we rebase this @HoussemNasri ? And also fix the build... |
2e6d0d6
to
aecb7f9
Compare
<artifactId>wiremock-standalone</artifactId> | ||
<version>3.10.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mock-server</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which tests uses mock-server in this module?
… operations - Implemented parsing of DAV multistatus responses - Implemented user calendar discovery via PROPFIND requests - Added WireMock for testing PROPFIND and REPORT methods as mockserver does not support custom HTTP methods.
- Because we use a mock server
Remove uncalled constructors in Dav exceptions Remove unneeded dependency Polish DavClient - Line break management - Avoid a bit code duplication - Use specialized UnaryOperator - static and final where possible Fix wiremock tests Drop unused test method Simplify DavServerExtension Drop mockserver Fix broken tests after dropping mockserver tmail-openpaas: Drop scala as it is no longer needed Remove mockserver from third-party/openpaas maven module Because it clashes with wiremock, which is needed for custom HTTP methods. Dependency clash will not be manageable on the long run. Co-authored-by: Benoit Tellier <[email protected]>
a8676bd
to
3735d13
Compare
Closes #1462
TODO:
If-Match
header not to update calendar objects that changed since they have been retrieved.